package com.yellowpage.nsp.listener;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;



public class FetchNSPUserListener implements ServletContextListener{
	   Timer timer=new Timer();

	    public void contextInitialized(ServletContextEvent event){        

	        long delayTime =  60000 - System.currentTimeMillis() % 60000;

	        //整5分开始, 隔5分钟
	        timer.schedule(new FetchNSPUserTask(event),delayTime,60000);
	    }

	    public void contextDestroyed(ServletContextEvent event){
	        timer.cancel();
	    }

}
